import service from "@/utils/request";
import type { Response, PageResponse, CodeName } from "@/types/common";
import type { AttendPlanItem } from "@/types/attend/plan";

export const useAttendPlanPageApi = (params: object) => {
  return service<any, Response<PageResponse<AttendPlanItem>>>({
    url: `/v1/attend/plan/page`,
    method: "GET",
    params,
  });
};

export const useAttendPlanQueryApi = (params: object) => {
  return service<any, Response<AttendPlanItem>>({
    url: `/v1/attend/plan/query`,
    method: "GET",
    params,
  });
};

export const useAttendPlanCreateApi = (data: object) => {
  return service({
    url: `/v1/attend/plan/create`,
    method: "POST",
    data,
  });
};

export const useAttendPlanUpdateApi = (data: object) => {
  return service({
    url: `/v1/attend/plan/update`,
    method: "POST",
    data,
  });
};

export const useAttendPlanDeleteApi = (data: object) => {
  return service({
    url: `/v1/attend/plan/delete`,
    method: "DELETE",
    data,
  });
};
